package pkg16b_eca.api;

import java.util.ArrayList;
import se.oru.informatik.InformatikException;

/**
 * This is an interface, an interface is used by a class to have some sort of interface which classes is should be using.
 * If you use an interface you'll get a structure in the class, and it will throw an error if these classes is not overridden, of which classes you must have when setting it up.
 * Like I wrote, these classes must be overridden in the class that implements an interface, if the class isn't abstract of course...
 * 
 * This interface is used when you want to connect to the database.
 */
public interface IConnection {
    //Execute a query, when using this you can choose which query you want to execute. (not sure if we should have this)
    public void SQLExecuteQuery(final String query);
    //Insert SQL query. Used when inserting a value into the database.
    public void SQLInsert(final String tableName);
    public void SQLInsert(final String tableName, final String[] rows, final String[] values);
    //Update SQL query. Used when updating a table in the database.
    public void SQLUpdate(final String query);
    public void SQLUpdate(final String tableName, final String[] columns, final String[] whereColIs);
    //Select SQL query. Used when reading a value from the database. In case you want a value from the database, use this to select that data.
    public String SQLSelect(final String query);
    public String SQLSelect(final String[] value, final String[] tableName, final String[] where);
    public ArrayList<String> SQLSelectList(final String query) throws InformatikException;
    public ArrayList<String> SQLSelectListJoin(final String query, final String additionalQuery);
    public ArrayList<ArrayList<String>> SQLSelectMatrix(final String query);
    public String SQLGetAutoIncrement(final String tabell, final String kolumn);
    //Delete SQL query. Used when deleteing a value from the database.
    public void SQLDelete(final String query);
    public void SQLDelete(final String tableName, final String where);
}
